define(["jquery","underscore", "marionette"], function($, _, Marionette) {

	var ServiceModelView = Marionette.ItemView.extend({
			tagName : 'tr',
			template : _.template($('#tpl-service-model-row').html()),
			
			ui : {
				
			}, 
			
			events : {
				
			},

			modelEvents : {
				'change' : "modelChanged"
			},
			modelChanged : function() {

				this.render();
			},

			setActive : function() {
				if(!this.$el.hasClass('active')){
					this.$el.parent().find('a').removeClass('active');
					this.$el.addClass('active');
				}
			},

			setEditMode : function(){
				
				this.$el.html('');
				//this.$el.append(new CityModelEditView({model:this.model}).render().el);	
			},

			deleteField : function(){

				if(confirm(messages.default.button.delete.confirm.message())) {
					vent.trigger('destroyModel', this.model);
					this.close();
				}
			}

		});
		
	return ServiceModelView;
});